@bg-color: #b7d48a;
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;

    -o-user-select: none;
    -moz-user-select: none; /*火狐 firefox*/
    -webkit-user-select: none; /*webkit浏览器*/
    -ms-user-select: none; /*IE10+*/
    -khtml-user-select :none; /*早期的浏览器*/
    user-select: none;
}

#main {
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: space-around;
    width: 360px;
    height: 420px;
    background-color: @bg-color;
    margin: 100px auto;
    border: 10px solid #000;
    border-radius: 20px;
}

#stage {
    position: relative;
    width: 304px;
    height: 304px;
    border: 2px solid #000;

    &.active > div {
        display: none;
    }

    &.active #over {
        display: block;
    }
}

#score-panel {
    display: flex;
    width: 300px;
    justify-content: space-between;

    #btn {
        cursor: pointer;

        &.active {
            cursor: not-allowed;
            color: #777;
        }
    }
}

#snake {

    div {
        position: absolute;
        display: inline-block;
        width: 10px;
        height: 10px;
        border: 1px solid @bg-color;
        background-color: #000;
    }
}

#food {
    position: absolute;
    left: 100px;
    top: 100px;
    display: flex;
    width: 10px;
    height: 10px;
    flex-flow: row wrap;
    justify-content: space-between;
    align-content: space-between;
    animation: twinkle 1.2s linear 1.2s infinite alternate;

    span {
        display: block;
        width: 4px;
        height: 4px;
        background-color: #000;
    }
}

#over {
    display: none;
    font-size: 40px;
    font-weight: bold;
    width: 100%;
    text-align: center;
    margin-top: 120px;
    text-shadow: 2px 2px #999;
}

@keyframes twinkle {
    0% {
        opacity: 0.9;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 0.2;
    }
}